Skip to content

Update test case polygons so some should fail when lat / long is used…#4608

Closed
JacobJT wants to merge 1 commit into
parse-community:masterfrom
JacobJT:update/polygonTestCases
Closed

Update test case polygons so some should fail when lat / long is used…#4608
JacobJT wants to merge 1 commit into
parse-community:masterfrom
JacobJT:update/polygonTestCases

Conversation

@JacobJT

@JacobJT JacobJT commented Mar 6, 2018

Copy link
Copy Markdown

… improperly

@JacobJT

JacobJT commented Mar 6, 2018

Copy link
Copy Markdown
Author

This PR updates some of the Polygons used in the test spec, which should trigger tests to fail. Polygons were almost all squares that were mirrored over an x=y line, so it did not expose issues where the lat/long values either were or were not swapped appropriately.

Comment thread spec/ParsePolygon.spec.js
});

it('polygonContain query', (done) => {
const points1 = [[0,0],[0,1],[1,1],[1,0]];

@JacobJT JacobJT Mar 6, 2018

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the most important change. If the coordinates of either the polygon or the coordinate we are seeing if is contained within the polygon are reversed from what we intend, the check will fail. To be frank, many of the other changes may be completely moot, as they seem to be just validating data that exists and doesn't criss / cross. In all likelihood, everything but this line change could be scrapped to highlight the same results

@JacobJT

JacobJT commented Mar 7, 2018

Copy link
Copy Markdown
Author

The appropriate test was moved to #4609

@JacobJT JacobJT closed this Mar 7, 2018
dblythy added a commit to dblythy/parse-server that referenced this pull request May 29, 2026
Ports spec/ParsePolygon.spec.js to REST-based specs under spec/rest/objects/:
- polygon.spec.ts: object lifecycle, equalTo, and validation
- polygon-query.spec.ts: $geoIntersects point-in-polygon queries (parse-community#4608)
- polygon-mongo.spec.ts: MongoDB storage format and 2d/2dsphere indexes

Adds polygon/geoIntersects builders to spec/helpers/geo.ts and a
describe_only_db ambient declaration. No Parse JS SDK; the storage spec uses
the database adapter directly only where there is no REST surface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant